﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AppCode_Admin_CompanyDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["userNameAdmin"] == null)
            {
                Response.Redirect("../Home/HomePage.aspx");
            }
        }
        if (!IsPostBack)
        {
            String connect = WebConfigurationManager.ConnectionStrings["ConnectDatabase"].ToString();
            SqlConnection sqlConnect = new SqlConnection(connect);
            SqlDataAdapter sqlda = new SqlDataAdapter("select *from CompanyDetails", sqlConnect);
            DataSet ds = new DataSet();
            sqlda.Fill(ds);
            GridView1.DataSource = ds.Tables[0];
            GridView1.DataBind();
        }
    }
}